package com.yyplatform.admin.platform.role.model.entity;

import com.yyplatform.admin.infra.model.entity.BaseEntity;

import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.Table;
import lombok.Getter;
import lombok.Setter;

import java.util.Date;

/**
 * Created on 2024-09-13
 */

@Entity
@Getter
@Setter
@Table(name = "sys_login_history")
public class SysLoginHistoryEntity extends BaseEntity {

    @Column(name = "username", nullable = false, columnDefinition = " varchar(50) comment '用户名' ")
    private String username;


    @Column(name = "user_agent", nullable = false, columnDefinition = " varchar(200) comment '请求UA' ")
    private String userAgent;

    @Column(name = "ip", nullable = false, columnDefinition = " varchar(50) comment '请求IP' ")
    private String ip;

    @Column(name = "location", nullable = false, columnDefinition = " varchar(200) comment '请求地址' ")
    private String location;

    @Column(name = "browser", nullable = false, columnDefinition = " varchar(50) comment '浏览器' ")
    private String browser;

    @Column(name = "os", nullable = false, columnDefinition = " varchar(50) comment '操作系统'")
    private String os;

    @Column(name = "error_msg", nullable = false, columnDefinition = " varchar(50) comment '错误信息'")
    private String errorMsg;

    @Column(name = "error_code", nullable = false, columnDefinition = " int(11) comment '错误码'")
    private int errorCode;


    @Column(name = "request_time", nullable = false, columnDefinition = " datetime comment '请求时间' ")
    private Date requestTime;


    @Column(name = "cost", nullable = false, columnDefinition = " int(11) comment '耗时单位ms' ")
    private int cost;

}
